package cn.spark.study.sql

import org.apache.spark.SparkConf
import org.apache.spark.SparkContext
import org.apache.spark.sql.SQLContext

object GenericLoadS {
  def main(args: Array[String]): Unit = {
    val conf = new SparkConf()
        .setAppName("GenericLoadS")
        
    val sc = new SparkContext(conf)
    val sqlC = new SQLContext(sc)
    
    sqlC.read.load("hdfs://spark1:9000/users.parquet").select("name", "favorite_color").write.save("hdfs://spark1:9000/namesAndFavoriteColors_scala")
      
  }
}